import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    radio: "催化反应",
    voc:"",
    searchResult:[],
    resultNum: "",
    searchVoc:""

  },
  getters: {},
  mutations: {
    change(state,str) {
      this.state.radio = str;
    },
    changeVocs(state,str) {
      this.state.voc = str;
    },
    changeSearchResult(state,str){
      this.state.searchResult = str;
    },
    changeNum(state,str){
      this.state.resultNum = str;
    }
  },
  actions: {
    changeRadio(context,str) {
      this.commit("change", str);
		},
    changeVoc(context,str) {
      this.commit("changeVocs", str);
		},
    changeResult(context,str){
      this.commit("changeSearchResult",str);
    },
    changeNum(context,str){
      this.commit("changeNum",str);
    }
  },
  modules: {},
});
